home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000006_icon-group-sender _Sat Jan 4 00:03:06 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 3 Jan 1997 17:24:06 MST
  2. Date: Sat, 04 Jan 1997 00:03:06 GMT
  3. From: ia@stryx.demon.co.uk (Iain Alexander)
  4. Reply-To: ia@stryx.demon.co.uk
  5. Message-Id: <17370@stryx.demon.co.uk>
  6. To: icon-group@cs.arizona.edu
  7. Subject: Re: Help for an Icon Neophyte
  8. X-Mailer: PCElm 1.10
  9. Lines: 39
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: RO
  12. Content-Length: 1201
  13.  
  14. In message <32CC0638.692B@ohsu.edu> Stuart Robinson writes:
  15.  
  16. Well, I'm no expert, but I think I can answer most of your questions.
  17.  
  18. > I assume that I want to use something like map(line, &ucase, &lcase),
  19. > but where should I insert it?
  20.  
  21. I suggest either
  22.  
  23.     while line := read() do
  24.         map(line, &ucase, &lcase) ? { ... }
  25. or
  26.     while line := map(read(), &ucase, &lcase) do
  27.         line ? { ... }
  28.  
  29. > And should the csets &ucase and &lcase be bracketted by
  30. > single quotations marks?
  31.  
  32. No, they're (special) variable names.  You would use quotation
  33. marks if you were defining the sets explicitly e.g.
  34. 'abcdefghijklmnopqrstuvwxyz'
  35.  
  36. > Second, the program seems to hang up at the
  37. > end.  I have no idea why that's happening.
  38.  
  39. The loop
  40. >     while num +:= 1 do {
  41. >     write(left(num||" "||get(wlist), 12), right(get(wlist), 4))
  42. >     }
  43. has no way of terminating.  It doesn't care whether the write(...)
  44. succeeds or fails.  You want it to stop when the get() fails
  45. because it's run out of words.  I think you can say
  46.     num := 1
  47.     while write(left(num||" "||get(wlist), 12), right(get(wlist), 4)) do {
  48.         num +:= 1
  49.     }
  50. -- 
  51. Iain Alexander                    ia@stryx.demon.co.uk
  52.                     I.Alexander@bra0125.wins.icl.co.uk
  53.